-
Notifications
You must be signed in to change notification settings - Fork 10.5k
More thorough support for retrieving OpenAPI routes in a case-sensitive manner #59568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More thorough support for retrieving OpenAPI routes in a case-sensitive manner #59568
Conversation
…ument name for OpenAPI version retrieval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this and following up with a PR!
This has got me thinking that we should audit other places where we pass in documentName in the same way. As a result, it looks like we'll also want to make a change in OpenApiDocumentProvider. The same test around the API version should work here.
|
@captainsafia I've implemented your requested changes, added extra comments, improved existing ones and updated the title and description of PR to better reflect the changes. Let me know if you want me to do anything else! :) |
src/OpenApi/src/Extensions/OpenApiServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiDocumentProviderTests.cs
Show resolved
Hide resolved
|
Thanks for the review! I'll implement requested changes after my holiday (in ~2 weeks) |
|
@captainsafia I've processed the PR comments! |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
…ve manner (#59568) * When retrieving optione, use the lowercase document name, too * Added tests for checking if options monitor uses case-insensitive document name for OpenAPI version retrieval * Add XML comments to prevent bugs in the future * Improve comments on existing test * Add new tests for DocumentProvider which should also work case-insensitively * Fix build by adding necessary XML comment * Fix build of tests * Improve comments * Fix incorrect tests * Fix bugs around case-sensitive document names * Implemented PR comments
More thorough support for retrieving OpenAPI routes in a case-sensitive manner
This PR fixes some oversights from #59199 around retrieving OpenAPI documents case-insensitively.
Description
This PR modifies missed files from #59199 that use the registered document name as a key for retrieving services or options. This needs to be done case-insensitively to:
OpenApiOptionsis returned, which might contain different settings than what the user had configured.This PR also adds some more comments and improves existing ones based on the previous PR around case-insensitive OpenAPI document names.
Fixes #59175